package com.group7.cinema77.controller;

import com.group7.cinema77.common.R;
import com.group7.cinema77.pojo.User;
import com.group7.cinema77.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date 2022/9/30
 * @desc
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public R login(String username, String password){
        System.out.println("中文");
        User result = userService.login(username,password);

        if(result!=null){
            return R.ok();

        }else{
            return R.error();
        }

    }

}
